package com.lvan.consumer03.reveive;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.stereotype.Component;

/**
 * @author luom
 * @date 2021/9/5
 */
@Component
@EnableBinding(Sink.class)
public class DefaultMsgReceive {

    private final Logger logger = LoggerFactory.getLogger(DefaultMsgReceive.class);

    @StreamListener(Sink.INPUT)
    public void receiveMessage(String message) {
        logger.info("消费新消息: {}", message);
    }
}
